/*
 * 百度在线网络技术（北京）有限公司拥有本软件版权2021并保留所有权利。
 * Copyright 2021, Baidu.com,Inc 2:Baidu Online Network Technology (Beijing) Co.,Ltd,
 * All rights reserved.
 */

package com.azdebugit.autona.test.jso.other1;

import java.io.IOException;
import java.lang.reflect.Type;
import java.util.Random;

import com.alibaba.fastjson.serializer.JSONSerializer;
import com.alibaba.fastjson.serializer.ObjectSerializer;

public class UserIDValueSerializer implements ObjectSerializer {
    @Override
    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features) throws IOException {
        //serializer:{"address":"杭州","phone":"18603396966","date":"20180125","sex":"男","ID":
        //object:100
        //fieldName:ID
        //fieldType:class java.lang.Long
        //features:0
        Random r = new Random();
        Long value = (Long) object;
        String text = value + "元"+r.nextLong();
        serializer.write(text);
    }
}